﻿using UnityEngine;
using System.Collections;

public class LeverHerse : MonoBehaviour {

	public GameObject Orbe1;
	public GameObject Orbe2;
	public GameObject Orbe3;
	public GameObject Orbe4;
	public GameObject Orbe5;
	public GameObject Orbe6;
	public float speed;

	void finNiveauTuto()
	{
		Application.LoadLevel ("Niveau1");
	}

	
	// Update is called once per frame
	void Update () {

		if ((Orbe1.activeSelf == false) && (Orbe2.activeSelf == false) && (Orbe3.activeSelf == false) && (Orbe4.activeSelf == false) && (Orbe5.activeSelf == false) && (Orbe6.activeSelf == false)) 
		{
			if (transform.position.x >= 7){ 
			
				transform.position += new Vector3 (0, 0, 0); 
				Invoke("finNiveauTuto",5);
					}
			else transform.position += new Vector3 (speed * Time.deltaTime, 0, 0); 
		}

	}
}
